package ar.com.spsolutions.splibrary.user.role;

import java.util.ArrayList;
import java.util.List;

import ar.com.spsolutions.splibrary.entity.Entity;

public abstract class UserRole extends Entity {
	private static final long serialVersionUID = 5311763023867241373L;

	public abstract boolean isAdmin();

	public abstract boolean same(UserRole role);

	public abstract String getName();

	public void setName(final String name) {
		// stub
		this.getName();// por que chilla PMD
	}

	public static UserRole librarian() {
		return new LibrarianRole();
	}

	public static UserRole customer() {
		return new CustomerRole();
	}

	public static List<UserRole> roles() {
		final List<UserRole> roles = new ArrayList<UserRole>();
		roles.add(new LibrarianRole());
		roles.add(new CustomerRole());
		return roles;
	}
}
